<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" href="css/front.css" rel="stylesheet" />
<link type="text/css" href="css/main.css" rel="stylesheet" />
<link type="text/css" href="css/home.css" rel="stylesheet" />
<link type="text/css" href="css/alert.css" rel="stylesheet" />
<link type="text/css" href="css/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="common/JsSupport.js"></script>
<script type="text/javascript" src="page/keepAccounts/js/keepAccounts.js"></script>
<title>记账本</title>
</head>
<body style="overflow: auto">
	<%@ include file="../top.jsp" %>
	<div>
		<div>
						记账类型：
						<s:select id="type" name="detail.type" theme="simple"
						list="#{0:'支出' ,1:'收入', 2:'转账',3:'借入',4:'借出',5:'还债',6:'收债'}"></s:select>
					
			<form id="keepAccountForm">
				<table border="0">
					<tr style="display: none;">
						<td>明细id</td>
						<td><input id="detailId" type="text" name="detail.id" /></td>
					</tr>
					
					<tr>
						<!--   0    ====支出分类 -->
						<td name="expenditureTd">分类：</td>
						<td name="expenditureTd"><select id="expenditureCategory">
								<s:iterator value="expenditureCategoryList">
									<option value='<s:property value="id"/>'>
										<s:property value="categoryName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="expenditureTd">——</td>
						<td name="expenditureTd"><select id="subExpenditureCategory" name="detail.category.id">
								<s:iterator value="subExpenditureCategoryList">
									<option value='<s:property value="id"/>'>
										<s:property value="categoryName" />
									</option>
								</s:iterator>
						</select></td>
						<!-- 支出账户 -->
						<td name="expenditureTd">账户：
						</td>
						<td name="expenditureTd"><select id="expenditureAccount" name="detail.account.id">
								<s:iterator value="expenditureAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						
						<!--    1    ====收入分类 -->
						<td name="incomeTd" style="display: none;">分类：</td>
						<td name="incomeTd" style="display: none;"><select id="incomeCategory">
								<s:iterator value="incomeCategoryList">
									<option value='<s:property value="id"/>'>
										<s:property value="categoryName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="incomeTd" style="display: none;">——</td>
						<td name="incomeTd" style="display: none;"><select id="subIncomeCategory" >
								<s:iterator value="subIncomeCategoryList">
									<option value='<s:property value="id"/>'>
										<s:property value="categoryName" />
									</option>
								</s:iterator>
						</select></td>

						<!-- 收入的账户 -->
						<td name="incomeTd" style="display: none;">账户：
						</td>
						<td name="incomeTd" style="display: none;"><select id="incomeAccount">
								<s:iterator value="incomeAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>

						<!--    2    ====转账的2个账户 -->
						<!-- 转出 -->
						<td name="accountTransferTd" style="display: none;">转出：
						</td>
						<td name="accountTransferTd" style="display: none;"><select id="transferAccount1">
								<s:iterator value="allAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<!-- 转入 -->
						<td name="accountTransferTd" style="display: none;">转入：
						</td>
						<td name="accountTransferTd" style="display: none;"><select id="transferAccount2">
								<s:iterator value="allAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<!--    3    ====借入的账户 -->
						<td name="accountBorrowTd" style="display: none;">负债账户：
						</td>
						<td name="accountBorrowTd" style="display: none;"><select id="borrowAccount1" >
								<s:iterator value="debtAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="accountBorrowTd" style="display: none;">存入账户：
						</td>
						<td name="accountBorrowTd" style="display: none;"><select id="borrowAccount2" >
								<s:iterator value="incomeAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<!--    3    ====借出的账户 -->
						<td name="accountLoanOutTd" style="display: none;">转出账户：
						</td>
						<td name="accountLoanOutTd" style="display: none;"><select id="loanOutAccount1">
								<s:iterator value="loanOutAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="accountLoanOutTd" style="display: none;">债权账户：
						</td>
						<td name="accountLoanOutTd" style="display: none;"><select id="loanOutAccount2">
								<s:iterator value="creditorAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						
						<!--    4    ====还债的账户 -->
						<td name="accountPayDebtTd" style="display: none;">转出账户：
						</td>
						<td name="accountPayDebtTd" style="display: none;"><select id="payDebtAccount1">
								<s:iterator value="incomeAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="accountPayDebtTd" style="display: none;">负债账户：
						</td>
						<td name="accountPayDebtTd" style="display: none;"><select id="payDebtAccount2">
								<s:iterator value="debtAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>

						<!--    5    ====收债的账户 -->
						<td name="accountCollectDebtTd" style="display: none;">债权账户：
						</td>
						<td name="accountCollectDebtTd" style="display: none;"><select id="collectDebtAccount1">
								<s:iterator value="creditorAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="accountCollectDebtTd" style="display: none;">存入账户：
						</td>
						<td name="accountCollectDebtTd" style="display: none;"><select id="collectDebtAccount2">
								<s:iterator value="incomeAccounts">
									<option value='<s:property value="id"/>'>
										<s:property value="accountName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td><span style="color: red">*</span>金额：</td>
						<td><input id="amount" name="detail.amount" class="txt_input" />
						</td>

					</tr>
					<tr>
						<td><span style="color: red">*</span>日期：</td>
						<td><input type="text" id="happenedDate" name="detail.happenedDate" readonly="readonly" class="Wdate"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})">
						</td>
						<td>项目：</td>
						<td><select id="project" name="detail.project.id">
								<s:iterator value="projectList">
									<option value='<s:property value="id"/>'>
										<s:property value="projectName" />
									</option>
								</s:iterator>
						</select>
						</td>
						<td name="merchantTd">商家：</td>
						<td name="merchantTd"><select id="merchant" name="detail.merchant.id" >
							<option value="">（无）</option>
								<s:iterator value="merchantList">
									<option value='<s:property value="id"/>'>
										<s:property value="merchantName" />
									</option>
								</s:iterator>
						</select>
						</td>

					</tr>

					<tr>
						<td>说明：</td>
						<td colspan="4"><input id="remark" name="detail.remark" style="width: 400px" class="txt_input" /></td>
						<td><input type="button" id="submit" value="保存" /> <input type="reset" id="reset" value="重置"
							style="display: none;" /> <input type="button" id="clear" value="清空" />
						</td>
					</tr>
				</table>
			</form>
		</div>
<!-- 		<div id="tableDiv"></div> -->
	</div>
</body>

</html>